
                <div class="content col-xs-12 col-sm-10">
                        <div class="banner">
                            <p class="fl">管理用户 &nbsp; &nbsp;|| &nbsp; &nbsp; <a href="/user/add">添加用户</a></p>
                            <div class="addButton fr"><input name="" type="button" value="+   添加用户" /></div>                            
                        </div>
                    
                        <div class="tableUser">
                            <table>
                                <thead>
                                    <tr>
                                        <td width="15%">姓名</td>
                                        <td width="40%">手机号</td>
                                        <!-- <td width="15%">密码</td> -->
                                        <td width="15%">级别</td>
                                        <td width="15%">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                            <?php foreach ($userinfos as $news_item): ?>

                                    <tr>
                                        <td><?php echo $news_item['name']; ?></td>
                                        <td data-toggle="tooltip" data-container="body"><span><?php echo $news_item['mobile']  ?></span></td>
                                        <!-- <td>dbjkd</td> -->
                                        <td><?php 
                                        if ($news_item['level'] >= 100) {
                                            echo "管理员";
                                        }
                                        else {
                                            echo "普通用户";
                                        }
                                        ?></td>
                                        <?php if ($news_item['level'] < 100) { ?>
                                        <td class="red"><a href="<?php echo site_url('user/update/'.$news_item['userId']); ?>">修改</a></td>
                                        <td class="red"><a href="<?php echo site_url('user/delete/'.$news_item['userId']); ?>">删除</a></td>
                                        <?php 
                                        }
                                        else {
                                            $upurl = site_url('user/update/'.$news_item['userId']);
                                            echo "<td class=\"red\"><a href='".$upurl."'>修改</a></td>";
                                            echo "<td class=red>&nbsp;</td>";
                                        } 

                                    ?>
                                    </tr>
                                 <?php endforeach; ?>
                  
                                </tbody>
                                
                            </table>
                        </div>
                    
                </div>
            </div>
        </div>

<script type="text/javascript">
    $(".tableUser tbody tr:even").css("backgroundColor","#FFF");
            $(".tableUser tbody tr:odd").css("backgroundColor","#F0F4F8");
            $(".tableUser tbody tr").each(function(){
                $(this).find("td").each(function(){
                    if( $(this).index() == 1 ){
                        var spanNum = $(this).find("span").length;
                        for (var i = 2; i <= spanNum; i++) {
                            $(this).find("span").eq(i).hide();
                        }
                    }
                });
            });
            $(".nav ul li").bind("click",function(){
                $("ul .cur").removeClass("cur");
                $(this).addClass("cur");
            });
            $(function () { $("[data-toggle='tooltip']").tooltip(); });
    $(".addButton").bind("click",function(){    
        window.open("/user/add")
    });
</script>

